<%@page import="articles.controller.Utils"%>
<%@page import="articles.string.Replace"%>
<%@page import="java.util.Formatter"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.Format"%>
<%@page import="articles.model.Articles"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>

<%
	Format formatter = new SimpleDateFormat("MM-dd-yy");
	Format formatter1 = new SimpleDateFormat("MM_yyyy");
	List<Articles> article = (List<Articles>) request.getAttribute("article");
	String title = (String) request.getAttribute("title");
	String post = (String) request.getAttribute("post");
	String description = (String) request.getAttribute("description");
	String keywords = (String) request.getAttribute("keyword");
	List<Articles> list_article = (List<Articles>) request.getAttribute("list_article");
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
	<jsp:param name="description" value="<%=description %>" />
	<jsp:param name="keywords" value="<%=keywords %>" />
</jsp:include>
<div id="content">
	<div id="leftsidecontent" class="justify">
		<%
		if(post != null)
		{
		%>
			<div style="background: none repeat scroll 0 0 #DEDFDE;border: 1px solid #CCCCCC;border-radius: 5px 5px 5px 5px;line-height: 25px;margin: 0 auto 10px;padding: 10px;">
				<h1>Submit success</h1>
				
				<p>Want people know about your article ?  <strong>Share this now !!!</strong></p>
				
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
       addthis:url="http://www.yooarticles/article/<%=article.get(0).getAlias()%>"
       addthis:title="<%=article.get(0).getTitle()%>" 
       addthis:via="yooarticles"
       >
<a class="addthis_button_facebook_send"></a>
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
            <a class="addthis_button_tweet" tw:via="yooarticles"></a>
            <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
            <a class="addthis_counter addthis_pill_style"></a>
 </div>
 </div>
		<%
		}
		%>
		<article class="article-detail" itemscope
			itemtype="http://schema.org/Article">
			<jsp:include page="element/adv_four.jsp"></jsp:include>
		<br/><br/>
		<h2 itemprop="name">
			<a href="/article/<%=article.get(0).getAlias()%>" itemprop="url"><%=article.get(0).getTitle()%></a>
		</h2>
		
		<p>
			<strong>Author : </strong><span class="author" itemprop="author"><a
				href="/author/<%=article.get(0).getAuthorAlias()%>"
				title="Author <%=Replace.remove(article.get(0).getAuthor())%>"
				itemprop="url"><%=article.get(0).getAuthor()%></a> </span> | <strong>Date :</strong>
			<time datetime="<%=formatter1.format(article.get(0).getDate())%>">
			<a href="/date/<%=formatter1.format(article.get(0).getDate())%>"
				class="link_author"
				title="Date <%=formatter.format(article.get(0).getDate())%>"
				itemprop="url"><%=formatter.format(article.get(0).getDate())%></a></time> | <strong>View : </strong> <%=article.get(0).getView() %>
		</p>
		<details open> 
			<div class="adv-2">
				<jsp:include page="element/adv_three.jsp"></jsp:include>
			</div>
			<div class="adv-3">
				<jsp:include page="element/adv_three.jsp"></jsp:include>
			</div>
			<%
	 			String value = article.get(0).getContent().getValue().replaceAll("^[<]+[(br)]+[ ]+[/]+[>]+","").replaceAll("^[<]+[(br)]+[ ]+[/]+[>]+","");
					out.print(value);
			%>
			
		 </details>
		<div class="clearbreak"></div>
		</article>
	
        <div class="addthis_toolbox addthis_default_style ">
        <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
        <a class="addthis_button_tweet" tw:via="yooarticles"></a>
        <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
        <a class="addthis_counter addthis_pill_style"></a>
        </div>
	
		<%
		if(!article.get(0).getLink().equals("") || !article.get(0).getLinkEmbed().equals(""))
		{
		%>
		<div class="box">
			<%
				if(!article.get(0).getLink().equals(""))
									{
			%>
			<strong>Link website :</strong> <a
				href="<%=article.get(0).getLink()%>" class="link"><%=article.get(0).getLink()%></a><br />
			View information <a
				href="http://www.showsiteinfo.net/sites/<%=Utils.fomatDomain(article.get(0).getLink())%>" class="link" target="_blank"><%=Utils.fomatDomain(article.get(0).getLink())%></a> in showsiteinfo<br/>	
			<%
				}
									if(!article.get(0).getLinkEmbed().equals(""))
									{
			%>
			<strong>Link video : </strong><a
				href="<%=article.get(0).getLinkEmbed()%>" class="embed"><%=article.get(0).getLinkEmbed()%></a>
			<%
				}
			%>
		</div>
		<%
		}
		%>
		<div class="box">
			<strong>LANGUAGE : </strong>
			<a
					href="http://www.yooarticles.com/article/<%=article.get(0).getAlias()%>"
					title="<%=Replace.remove(article.get(0).getTitle())%>"><img
					src="/image/flag_english.gif" alt="English"></img> </a>
				<%
					if(article.get(0).getVodeNo()>=1)
													{
				%>
				<a
					href="http://es.yooarticles.com/article/<%=article.get(0).getAlias()%>"
					title="<%=Replace.remove(article.get(0).getTitle())%>"><img
					src="/image/flag_Spanish.png" alt="Spanish"></img> </a>
				<%
					}
				%>
				<%
					if(article.get(0).getVodeNo()>=2)
													{
				%>
				<a
					href="http://pt.yooarticles.com/article/<%=article.get(0).getAlias()%>"
					title="<%=Replace.remove(article.get(0).getTitle())%>"><img
					src="/image/pt.png" alt="Portuguese"></img> </a>
				<%
					}
				%>
		</div>
		<jsp:include page="element/adv_four.jsp"></jsp:include>
		<div class="box">
			<strong>TAGS : </strong>
			<%
				if(article.get(0).getKeyword() != null)
									{	
										String[] tags = article.get(0).getKeyword().getValue().split(",");
										for(int i=0;i<tags.length;i++)
										{
											String alias = new Replace().replace(tags[i]);
											if(i != 0)
												out.print(" , ");
			%>
			<a href="/tags/<%=alias%>" title="Tags <%=tags[i]%>" class="ta"><%=tags[i]%></a>
			<%
				}
									}
			%>
			<div class="clearbreak"></div>
		</div>
		<div id="fb-root"></div>
		<script
			src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1"></script>
		<fb:comments
			href="http://www.yooarticles.com/article/<%=article.get(0).getAlias() %>"
			width="520"></fb:comments>
	</div>
	<div id="rightsidecontent">
		<jsp:include page="element/google_search.jsp"></jsp:include>
		<jsp:include page="element/hatforrent.jsp"></jsp:include>
		<jsp:include page="element/top_view.jsp"></jsp:include>

		<%
			if(list_article.size()>0)
			{
		%>
			<div class="simple-box"  itemscope itemtype="http://schema.org/ItemList">
				<h3 itemprop="name">The articles of '<%=article.get(0).getAuthor() %>' author</h3>
				<meta itemprop="itemListOrder" content="Descending" />
			    <div class="content-box">
			    	<div class="article-listing">
			            <ul>

						<%							
							for(int i=0;i<list_article.size();i++)
							{
								Articles tmp = list_article.get(i); 
						%>
								<li itemprop="itemListElement" itemscope itemtype="http://schema.org/Article">
									<h4 itemprop="name"><a href="/article/<%=tmp.getAlias() %>" title="Article <%=Replace.remove(tmp.getTitle()) %>" itemprop="url"><%=tmp.getTitle() %></a></h4>
									<p>Author : <span class="author" itemprop="author"><a href="/author/<%=tmp.getAuthorAlias() %>"  title="Author <%=Replace.remove(tmp.getAuthor()) %>" itemprop="url"><%=tmp.getAuthor() %></a></span> | 
									Date : <time datetime="<%=formatter.format(tmp.getDate()) %>"><a href="/date/<%=formatter.format(tmp.getDate()) %>"  title="Date <%=formatter.format(tmp.getDate()) %>" itemprop="url"><%=formatter.format(tmp.getDate()) %></a></time></p>
								</li>
						<%
							}								
						%>
						</ul>
			        </div>
			    </div>
			</div>
		<%
			}
		%>

		<jsp:include page="element/fanpage.jsp"></jsp:include>

	</div>
	<div class="clearbreak"></div>
</div>

<div class="hidden_category"><%=article.get(0).getCategoryAlias()%></div>
<%@ include file='/layout/footer.jsp'%>